#ifndef __P_TIME_H__
#define __P_TIME_H__

#include <DS1302.h>

typedef uint32_t Timestamp_t;

void sync_sys_time(void);
void print_local_time(void);

void sync_sys_time_to_ds1302(void);
void sync_to_ds1302(Time *);
Timestamp_t timestamp_from_ds1302(void);
Time get_time_from_ds1302(void);
void ds1302_test();

Timestamp_t get_timestamp(Time *t);
char *timestamp_key(Timestamp_t ts);
Time parse_timestamp(Timestamp_t timestamp);
void timestamp_test();

void print_ds1302_time(void);
char *format_ds1302_time(Time *t);
char *format_ds1302_time_no_wday(Time *t);
char *format_ds1302_timestamp_no_wday(Timestamp_t timestamp);


#endif